from apps.activity.models import Gathering
from rest_framework import serializers


class GatherSerializerSimple(serializers.ModelSerializer):
    # 活动列表
    users = serializers.PrimaryKeyRelatedField(read_only=True,many=True)

    class Meta:
        model = Gathering
        fields = ('id','name','image','city','starttime','endrolltime','users')


class GatherSerializer(serializers.ModelSerializer):
    # 活动详情页
    users = serializers.PrimaryKeyRelatedField(read_only=True,many=True)

    class Meta:
        model = Gathering
        fields = "__all__"
